[Rainmeter]

[Metadata]
Name=Gemstone4Rainmeter CurrentWeather
Author=jusjoken
Information=CurrentWeather Widget for Gemstone4Rainmeter | Instructions: | - User adjustable settings in UserConfig.inc
Version=1.000
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
@IncludeCommonVars="#@#src\CommonVars.inc"
@Include="#ROOTCONFIGPATH#UserConfig.inc"
pBase = http://#ServerName#:#ServerPort#/sagex/phoenix
@IncludePhoenix="#@#src\PhoenixCalls.inc"
WebParserSubstitute="<![CDATA[":"","]]>":"","/PRE&gt;":"","PRE&gt;":"","&nbsp;":" "
@IncludeCommonStyles="#@#src\CommonStyles.inc"
tImageName=BackgroundStyleName#BackgroundStyle#


;======================================================
; Measures
;======================================================

[MeasureScript]
Measure=Script
ScriptFile="#@#src\Gemstone.lua"
UpdateDivider=-1

[ConnectCheck]
Measure=Calc
Formula=(ConnectCheck+1)%(#CheckEvery#+1)
IfEqualValue=#CheckEvery#
IfEqualAction=!CommandMeasure MeasureScript ConnectCheck()

;only run on startup
[pWeatherInit]
Measure=Plugin
Plugin=WebParser
URL=#pWeatherInit#
UpdateDivider=-1
RegExp=(?siU)(.*)$
StringIndex=1
Debug=1
Substitute=#WebParserSubstitute#
ForceReload=1
FinishAction=!CommandMeasure MeasureScript WeatherInit()

;run on a refresh cycle
[pWeatherUpdate]
Measure=Plugin
Plugin=WebParser
URL=#pWeatherUpdate#
UpdateRate=10
RegExp=(?siU)(.*)$
StringIndex=1
Debug=1
Substitute=#WebParserSubstitute#
ForceReload=1
FinishAction=!CommandMeasure MeasureScript WeatherUpdate()

;run on a refresh cycle if Init is successful
[pCurrentWeather]
Measure=Plugin
Plugin=WebParser
URL=#pCurrentWeather#
UpdateRate=20
RegExp=(?siU)(.*)$
StringIndex=1
Debug=1
Substitute=#WebParserSubstitute#
ForceReload=1
Disabled=1
FinishAction=!CommandMeasure MeasureScript WeatherLoad()

[pCWSwitchWallpaper]
Measure=Script
ScriptFile="#@#src\ChangeWallpaper.lua"
UpdateDivider=#CWSwitchWallpaperDelay#
DynamicVariables=1
Disabled=1
;FinishAction=!CommandMeasure MeasureScript UpdateWallpaper()


;======================================================
; Meters to display UI info
;======================================================

[BackgroundMeter]
Meter=IMAGE
MeterStyle=BackgroundStyle | BackgroundStyle#BackgroundStyle#

[pCWTitle]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherItemStyle
Group=WeatherTitle
X=((#SkinWidth#-#MarginLeft# - #MarginRight#)/2+#MarginLeft#)
Y=#CWTitleY#
W=(#SkinWidth#-#MarginRight#-#MarginLeft#)
Text="Current Weather"

[pCWTitleDivider]
Meter=IMAGE
MeterStyle=DividerStyle
Group=WeatherTitle
Y=#CWTitleDividerY#

[pCWTempLabel]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherLabelStyle
X=#CWTempX#
Y=#CWTempLabelY#
W=#CWWS1#
Text="Temp"

[pCWGetTempMeter]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherItemLargeStyle
Group=CurrentWeather
X=#CWTempX#
Y=#CWTempY#
W=#CWWS1#
Text=""

[pCWGetIconMeter]
Meter=IMAGE
ImageName=na.png
Path=#WeatherIcons##WeatherIconSet#\
;MeterStyle=WeatherBaseStyle | WeatherItemLargeStyle
PreserveAspectRatio=1
DynamicVariables=1
Group=CurrentWeather
X=#CWIconX#
Y=#CWIconY#
W=#CWWS1#

[pLoadingMeter]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherItemStyle
;StringAlign=Left
X=((#WorkingW#/2)+#MarginLeft#)
Y=#CWTempY#
W=#WorkingW#
Text="Loading...."

[pCWHumidLabel]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherLabelStyle
X=#CWHumidX#
Y=#CWHumidLabelY#
W=#CWWS1#
Text="Humidity"

[pCWGetHumidMeter]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherItemLargeStyle
Group=CurrentWeather
X=#CWHumidX#
Y=#CWHumidY#
W=(#CWWS1#+5)
Text=""

[pCWCondLabel]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherLabelStyle
X=#CWCondX#
Y=#CWCondLabelY#
W=#CWWS2#
Text="Condition"

[pCWGetConditionMeter]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherItemStyle
Group=CurrentWeather
X=#CWCondX#
Y=#CWCondY#
W=(#CWWS2#+10)
Text=""

[pCWWindLabel]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherLabelStyle
X=#CWWindX#
Y=#CWWindLabelY#
W=#CWWS2#
Text="Wind"

[pCWGetWindSpeedMeter]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherItemStyle
Group=CurrentWeather
X=#CWWindX#
Y=#CWWindY#
W=#CWWS2#
Text=""

[pCWGetWindDirMeter]
Meter=IMAGE
ImageName=#@#Images\CompassMarkerSmall.png
Hidden=1
PreserveAspectRatio=0
DynamicVariables=1
ImageRotate=0
Group=CurrentWeather
X=(#WorkingW#-40+#MarginLeft#)
Y=(#CWWindY#-15)
W=40

[pCWGetLocationMeter]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherItemInfoStyle
Group=WeatherFooter
X=#CWLocX#
Y=#CWLocY#
W=#WorkingW#
Text=""

[pCWGetUpdatedMeter]
Meter=String
MeterStyle=WeatherBaseStyle | WeatherItemInfoStyle
Group=WeatherFooter
X=#CWUpdX#
Y=#CWUpdY#
W=#WorkingW#
Text=""
